package com.imooc.course.business.controller.admin;

import com.imooc.course.business.form.ShortMessagingServiceForm;
import com.imooc.course.business.form.PageForm;
import com.imooc.course.server.dto.ShortMessagingServiceDto;
import com.imooc.course.server.dto.PageDto;
import com.imooc.course.server.dto.ResponseDto;
import com.imooc.course.server.service.ShortMessagingServiceService;
import com.imooc.course.server.utils.CopyUtil;
import com.imooc.course.server.utils.ValidatorUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/sms")
public class ShortMessagingServiceController {

    private static final Logger log = LoggerFactory.getLogger(ShortMessagingServiceController.class);
    public static final String BUSINESS_NAME = "短信验证码";


    @Resource(name = "shortMessagingServiceService")
    private ShortMessagingServiceService shortMessagingServiceService;

    /**
     * 查询列表
     * @param pageForm 传入的page和size
     * @return
     */
    @PostMapping("/list")
    public ResponseDto getList(@RequestBody PageForm pageForm) {
        PageDto pageDto = CopyUtil.copy(pageForm, PageDto.class);
        shortMessagingServiceService.getList(pageDto);
        return ResponseDto.success().setContent(pageDto);
    }


}
